package com.tanhua.manage.controller;

import com.tanhua.manage.service.UserService;
import com.tanhua.model.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    // 查询用户列表
    @GetMapping
    public PageResult findList(@RequestParam(defaultValue = "1") Integer pageNumber,
                                   @RequestParam(defaultValue = "5") Integer pageSize){


        PageResult pageResult = userService.findList(pageNumber,pageSize);

        return pageResult;
    }

    // 查询用户坐标
    @GetMapping("/map")
    public String selectLocation(Long userId){

        // 调用service查询
        String location = userService.selectLocation(userId);

        return location;
    }
}
